<template>
	<view class="user-order">
		 <view class="order-list" v-for="(item,index) in orderList" :key='index' >
			  <image class="order-list-img"  :src="item.orderImgUrl"></image>
			  <view class="order-list-right" @click="tapwuliu(item)">
				  <view class="maincolor">{{item.actualPayPrice}}</view>
				  <view>{{item.areaAddress}}{{item.detailAddress}}</view>
				  <view class="">
					   <view>{{item.consigneeMobile}}</view>
					   <view>
						   <text style="color: #333;">下单时间:</text>
					   {{item.createTime}}</view>
				  </view>
				  <view v-if="item.logisticsNo" class="maincolor">
					  查看物流
				  </view>
			  </view>
		 </view>
		 
		 <view v-if="orderList.length == 0">
		 	<u-empty
		 	marginTop='100'
		 	text='还没有订单哦'
		    mode="data"
		 	>
		 	</u-empty>
		 </view>
	</view>
</template>

<script>
	import {getOrderListApi,getlogisticsInfoApi}  from '@/config/goodApi.js'
	export default {
		data() {
			return {
				orderList:[],
				pageNum:1
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			
			tapwuliu(e){
				if(e.logisticsNo){
					var addr =e.areaAddress +e.detailAddress
				uni.navigateTo({
					url:'/pages/goods/logistics?id=' + e.id + '&addr=' +addr
				})
				}else{
					uni.$u.toast('暂未发货')
				}
			},
			getList(){
				getOrderListApi({
					pageNum:this.pageNum,
					orderStatus:201
				}).then(res=>{
					this.orderList = res.records
				})
			}
		},
		onReachBottom() {
			this.pageNum++
			this.getList()
		}
	}
</script>

<style lang="scss" scoped>
 .user-order{
	 height: 100vh;
	 // background-color: #f6f6f6;
	 .order-list{
		 background: rgba(255, 255, 255, 1);
		 box-shadow: 0px 2px 4px rgba(0, 0, 0, .5);
		 width: calc(100% - 30rpx);
		 margin-left: 15rpx;
		 margin-bottom: 20rpx;
		 padding: 20rpx;
		 border-radius: 10rpx;
		 box-sizing: border-box;
		 display: flex;
		 &-img{
			 width: 200rpx;
			 height: 200rpx;
			 margin-right: 10rpx;
		 }
		 &-right{
			 flex: 1;
			 flex-shrink: 0;
			 font-size: 24rpx;
			 color: #999999;
		 }
	 }
 }
</style>
